package cn.iocoder.yudao.module.biz.controller.admin.invoice.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * 发票管理表
 * @TableName san_biz_invoice_management
 */
@TableName(value ="san_biz_invoice_management")
@Data
@Schema(description = "管理后台 - 业务拓展-发票管理表")
public class SanBizInvoiceManagement implements Serializable {


    @Schema(description = "页码，从 1 开始", requiredMode = Schema.RequiredMode.REQUIRED,example = "1")
     @NotNull(message = "页码不能为空")
    @Min(value = 1, message = "页码最小值为 1")
    @TableField(exist = false)
    private Integer pageNo = 1;

    @Schema(description = "每页条数，最大值为 100", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
     @NotNull(message = "每页条数不能为空")
    @Min(value = 1, message = "每页条数最小值为 1")
    @Max(value = 100, message = "每页条数最大值为 100")
    @TableField(exist = false)
    private Integer pageSize = 10;


    /**
     * 主键ID
     */
    @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @TableId(type = IdType.AUTO)
    private Long id;

    @Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
    // @NotEmpty(message = "合同编号不能为空")
    private String contractCode;

    @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
    // @NotEmpty(message = "名称不能为空")
    private String name;

    @Schema(description = "社会信用代码/纳税人识别号", requiredMode = Schema.RequiredMode.REQUIRED)
    // @NotEmpty(message = "社会信用代码/纳税人识别号不能为空")
    private String taxIdNumber;

    @Schema(description = "联系电话")
    private String contactPhone;

    @Schema(description = "开户银行", example = "李四")
    private String bankName;

    @Schema(description = "开户账号", example = "21353")
    private String bankAccount;

    @Schema(description = "地址")
    private String address;

    @Schema(description = "发票号码")
    private String invoiceNumber;

    @Schema(description = "开票日期")
    private LocalDateTime invoiceDate;

    @Schema(description = "票种", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    // @NotEmpty(message = "票种不能为空")
    private String invoiceType;

    @Schema(description = "特定业务", requiredMode = Schema.RequiredMode.REQUIRED)
    // @NotEmpty(message = "特定业务不能为空")
    private String specificBusiness;

    @Schema(description = "发票金额", requiredMode = Schema.RequiredMode.REQUIRED)
    // @NotNull(message = "发票金额不能为空")
    private BigDecimal invoiceAmount;

    @Schema(description = "税率", requiredMode = Schema.RequiredMode.REQUIRED)
    // @NotNull(message = "税率不能为空")
    private BigDecimal taxRate;

    @Schema(description = "税金", requiredMode = Schema.RequiredMode.REQUIRED)
    // @NotNull(message = "税金不能为空")
    private BigDecimal taxAmount;

    @Schema(description = "不含税金额", requiredMode = Schema.RequiredMode.REQUIRED)
    // @NotNull(message = "不含税金额不能为空")
    private BigDecimal amountWithoutTax;

    @Schema(description = "备注")
    private String remarks;

    @Schema(description = "销方银行")
    private String sellerBank;

    @Schema(description = "分期记录id")
    private Long contractReceiveRecordId;

    @Schema(description = "合同名称")
    private String contractName;

    @Schema(description = "云开票状态")
    private String cloudStatus;

    @Schema(description = "签收人")
    private String signName;

    @Schema(description = "作废时间")
    private LocalDateTime cancelTime;

    @Schema(description = "发票状态")
    private String status;

    @Schema(description = "合同总金额")
    private BigDecimal contractPriceNumber;
    @Schema(description = "合同开始日期")
    private LocalDateTime contractStartTime;
    @Schema(description = "期数")
    private Integer instalmentCount;
    @Schema(description = "收款金额")
    private BigDecimal receiveMoney;
    @Schema(description = "收款日期")
    private LocalDateTime receiveDate;

    @Schema(description = "审核状态，0待提交，1提交，2通过，3不通过")
    private Integer approveStatus;

    @Schema(description = "审核不通过原因")
    private String approveNo;

    /**
     * 创建者
     */
    private String creator;

    /**
     * 更新时间
     */
    private Date updatedAt;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新者
     */
    private String updater;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 是否删除
     */
    private Boolean deleted;

    /**
     * 租户ID
     */
    private Long tenantId;

    /**
     * 服务单元
     */
    @TableField(exist = false)
    private String serviceTeam;

    /**
     * 客户名称
     */
    @TableField(exist = false)
    private String customerName;

    @Schema(description = "公司信息id")
    private Long companyId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 客户名称
     */
    @TableField(exist = false)
    private List<SanBizInvoiceContent> items;

}
